int ftcode(int seed, char *data, int datalen, char *out)
{
    unsigned randint = 0;
    char randchar;
    int i;
    randint = seed;

    for(i=0;i<datalen;i++)
    {
        randint = (randint * 214013 + 2531011) & 0x7FFFFFFF;
        randchar = ((randint >> 16) & 0x7FFF) % 255;
        out[i]=data[i]^randchar;
    }
    return 0;
}
